package util

import (
	"gorm.io/gorm"
)


func Getmax(DB *gorm.DB, name string, tabname string) (int, error) {
	var id int
	var err error
	if err1 := DB.Raw("SELECT MAX(" + name + ") FROM " + tabname).Scan(&id).Error; err != nil {
		err = err1
	}
	return id, err
}
